Blog

What is Cursor AI, the ChatGPT Replacement for Coding

Cursor AI has taken the programming world by storm. Developers are replacing Microsoft’s VS Code with Cursor as their favorite new IDE. It’s being called a true AI code editor and folks like Andrej Karpathy, the former senior director of AI at Tesla, have praised it. Cursor has received funding from Andreessen Horowitz, Jeff Dean, John Schulman, Noam Brown, and the founders of Stripe and GitHub.

But how is it different from GitHub Copilot in VS Code and what new features does Cursor bring? Let us understand it.

What is Cursor AI?

First things first, Cursor is a fork of VS Code so it has a familiar interface and you can import all your extensions, themes, and keybindings in one click. It also offers its own ‘cursor-small’ AI model which is not a premium model but can be helpful for quick editing tasks. Apart from its small model, Cursor supports several premium models from OpenAI, Google, and Anthropic.

You can use premium models like OpenAI o1, Claude 3.5 Sonnet, GPT-4o, GPT-4, Claude 3 Opus, and more. It also lets you add your API key which is great. Initially, Cursor is offering two weeks of free Pro trial that uses Claude 3.5 Sonnet for code completion and other tasks.

Cursor Learns from Your Codebase

The best part about Cursor is that it learns from your codebase and creates embeddings on your device to predict your next edit accurately. Just keep hitting ‘Tab’ to accept autocomplete suggestions. It surely boosts productivity by many folds. By the way, if you are worried about your data, you can choose private mode during the setup to opt out of training.

cursor composer feature

It also lets you set rules for the AI editor. You can define .cursorrules file for each repo and Cursor will follow those instructions. For example, if you are writing an iOS app, you can define your rules and preferences for the Swift language. You can even define different AI rules for specific files.

Cursor Composer, The Headline AI Feature

Now, comes the most vital feature of Cursor — Composer. It can be triggered with the shortcut: Ctrl + K. In the Composer box, you can enter instructions in natural language and it generates code right there. Either select a code snippet or simply choose the current file, and ask for improvements or refactor the code. Press ‘Ctrl + Enter’ and quickly accept the suggestions.

cursor composer tag files and folders

The best part about Composer is that you can use ‘@’ in the Composer box to tag files, folders, web links, codebase, Git, etc., and add detailed instructions on what you want to achieve. You can even tag official docs from OpenAI, Microsoft, AWS, etc. It truly unlocks the potential of AI coding assistance.

Apart from that, you can press Ctrl + L to open the chat window where you can ask questions, chat with your local codebase, and get code suggestions. Moreover, you can select a chunk of code and press the shortcuts to bring up the Composer or Chat window. You can now review the changes and add coding suggestions in no time.

Finally, you can also debug the code using AI. It’s well integrated within the environment and quickly tells you what changes to make in a Chat window. Overall, Cursor is a fantastic AI code editor, and with the Claude 3.5 Sonnet model, it really ups the game for coders.


Source link

Related Articles

Back to top button
close